#include <stdio.h>

int main ()
{
	int a,b,rem;
	int Div,Multi;
	
	scanf("%d %d",&a,&b);
	Multi = a*b;
	if ( a>b ) {
		rem = a%b;
		while ( rem ) {
			a = b;
			b = rem;
			rem = a%b;
		}
		Div = b;
	} else {
		rem = b%a;
		while ( rem ) {
			b = a;
			a = rem;
			rem = b%a;
		}
		Div = a;
	}
	Multi /= Div;
	printf("%d\n%d",Div,Multi);
	return 0;
}